package gui.dialog;

import java.awt.Dimension;
import java.awt.Window;

import javax.swing.JDialog;

public abstract class ChatDialog extends JDialog {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	public ChatDialog (Window master, String title, Dimension dimension) {
		super (master) ;
		setTitle(title) ;
		setModal(true) ;
		setSize(dimension) ;
		setPreferredSize(dimension) ;
		setResizable(false) ;
	}
	
	@Override
	public void setVisible (boolean visible) {
		setLocation((getParent().getWidth() - this.getWidth())/2, (getParent().getHeight() - this.getHeight())/2) ;
		setLocationRelativeTo(getParent()) ;
		super.setVisible(visible) ;
	}

}
